package dao;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import str.Language;
import util.Constants;

import org.apache.log4j.Logger;

import db.DbController;

public class DbLanguages {

    ///////////////////
    
    public static int insert(String name) {
    	
    	Connection cnn = null;
        CallableStatement cstat = null;
        
        try {
            cnn = DbController.getConnection();
            cstat = cnn.prepareCall("{call m_languages_insert(?)}");
            cstat.setString(3, "N'" + name + "'");
            
            return cstat.executeUpdate();
        }
        
        catch (SQLException e) {
			// TODO: handle exception
        	return 0;
		}       
    }

    public static int delete(int langID) {
    	
    }
    
    public static ResultSet getLanguageID(String name) {
    	
    }
    
    public static ResultSet getLanguageID(int langID) {
    	
    }
    
    public static ResultSet getCount() {
    	
    }
    
    public static ResultSet getLanguageName(int langID) {
    	
    }
}
